package com.five.dao;
import com.five.pojo.ClubJoin;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author lenovo
 */
@Mapper
public interface ClubJoinDao {
    //申请入团
    @Insert("insert into clubJoin(s_name , s_phone , s_class , s_gender , c_name , c_type , c_jointime , status , c_header) " +
            "values(#{sName} , #{sPhone} , #{sClass} , #{sGender} , #{cName} , #{cType} , #{cJoinTime} , #{status} , #{cHeader}) ")
    void add(ClubJoin clubJoin);

    //查询入团申请信息
    @Select("select * from clubjoin")
    List<ClubJoin> getAllJoin();

    List<ClubJoin> list(String cName , String sName);

    @Select("select count(*) as un_handle from clubjoin where status=0")
    Integer getStatus();

    @Update("update clubjoin set status=#{status} where id=#{id}")
    void updateStatus(Integer status, Integer id);

    @Select("select * from clubjoin where c_header=#{header}")
    List<ClubJoin> getByHeader(String header);

    @Delete("delete from clubjoin where id=#{id}")
    void deleteById(Integer id);
}
